home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / unarced / graphics / hamlabdemo / docs / hamlab.doc < prev   
Text File  |  1995-03-17  |  15KB  |  438 lines

  1. HamLab Version 1.1
  2. (c) Copyright 1990, 1991 J. Edward Hanway
  3. All rights reserved.
  4.  
  5. OVERVIEW
  6.  
  7.     The purpose of HamLab is to read "foreign" images, especially those
  8.     created for high-resolution, deep-bitmap displays, and convert them
  9.     to Amiga Hold-and-Modify (HAM) and Sliced-HAM images, while trying
  10.     to preserve as much of the original's quality as possible.  The HAM
  11.     and SHAM images can be displayed (on a large "virtual screen" if
  12.     necessary) and saved as    IFF files, suitable for use with a HAM
  13.     paint program like NewTek's DigiPaint.
  14.  
  15.     Currently, HamLab understands the following formats:
  16.     
  17.     GIF, TIFF, Spectrum 512, MTV, QRT, DKBTrace, PBMPLUS, Sun Rasters
  18.     
  19.     HamLab should work on images up to about 1500 pixels wide and any
  20.     height, although you will probably need a 1M Agnus chip to display
  21.     images more than 1008 pixels wide.  HamLab has been tested with
  22.     1152 x 900 and similar images.
  23.  
  24.  
  25. SYSTEM REQUIREMENTS
  26.  
  27.     REQUIRED
  28.  
  29.     AmigaDOS 1.3 and ARP 1.3 (only the 17100 byte LIBS:arp.library file
  30.     is required)
  31.     
  32.     *OR*
  33.     
  34.     AmigaDOS 2.x
  35.     
  36.     RECOMMENDED
  37.  
  38.     PIPE: device (comes with AmigaDOS; needed only if the
  39.     "Use Pipes" option is used)
  40.  
  41.         
  42.     HamLab runs on a 68000, a 68030, and everything in between.
  43.     
  44.     At least one megabyte of memory is recommended.  (That should be
  45.     enough to work with 640 x 480 images when the "Use Pipes" option
  46.     is used.)
  47.  
  48.  
  49. INTRODUCTION
  50.  
  51.     To use HamLab effectively, it helps to understand the basic idea
  52.     of what it's doing behind the scenes.  The complete conversion
  53.     process looks like this:
  54.     
  55.         Original image
  56.             |
  57.             | filtering
  58.             v
  59.         24-bit image
  60.             |
  61.             | scaling, color mapping, then quantizing
  62.             | (with optional dithering)
  63.             v
  64.         12-bit (4096-color) image
  65.             |
  66.             | cropping, then analysis
  67.             v
  68.         12-bit image + 16-color palette
  69.             |
  70.             | display or save
  71.             v
  72.         cropped HAM image
  73.         
  74.     In the first step, called filtering, the original image is decoded
  75.     and the image data is saved in a temporary 24-bit RGB file.  This
  76.     is the only step where the original image format (GIF, TIFF, etc.)
  77.     matters.
  78.     
  79.     In the next step, several things happen.  First, the image is
  80.     resized, then the color of each pixel is remapped using the color
  81.     response curves (this allows adjustments for brightness,
  82.     contrast, etc.), then the 24-bit RGB data is crammed into the
  83.     4096-color palette of the Amiga, optionally using dithering.
  84.     
  85.     The 4096-color image is then cropped, then HamLab analyzes the
  86.     remaining area to select 16 color registers that will minimize the
  87.     "fringing" associated with Hold-And-Modify mode.
  88.     
  89.     Once the 16 color registers have been selected, the 4096 color
  90.     picture    can be displayed or saved in HAM mode.
  91.  
  92.  
  93. COMMANDS
  94.  
  95.     OPEN        (shortcut: 'o')
  96.  
  97.     This command brings up a file requester and allows you to
  98.     open a new image file.  HamLab tries to identify the file according
  99.     to its configuration information, and if it can be identified, the
  100.     appropriate input filter will be run and the image will be
  101.     converted to a 24-bit RGB temporary file.
  102.     
  103.     If the "Use Pipes" option is selected, then a temporary file won't
  104.     be created. Instead, a pipe will be opened and part of what is
  105.     normally the ANALYZE command will be executed using the data coming
  106.     through the pipe.  See below for more information on using pipes.
  107.  
  108.     ANALYZE        (shortcut: 'a')
  109.  
  110.     This command reads the 24-bit temporary file and does the necessary
  111.     calculations (called quantizing) to fit it to the Amiga's 4096
  112.     color palette, then picks 16 colors to use in HAM mode to minimize
  113.     HAM fringing artifacts (analyzing).  Depending on how you set the
  114.     "Cache12Bit" option in the configuration file (see below) the
  115.     resulting picture will either be held in RAM or in another
  116.     temporary file.
  117.     
  118.     Color correction and scaling are also done in the quantizing step.
  119.  
  120.     DISPLAY        (shortcut: 'd')
  121.  
  122.     This command opens an intuition HAM or SHAM screen and renders the
  123.     picture into it.  If your Workbench screen is overscanned, this
  124.     screen will be overscanned, too.  If the image that you're
  125.     converting is larger than the screen size, then you can pan around
  126.     the image using the arrow keys or by holding down the left mouse
  127.     button and dragging.  The right mouse button or space bar will close
  128.     the display screen.  (Other shortcut keys still work, too.)
  129.     
  130.     SHAM screens are limited to 320 pixels wide (any wider and the
  131.     Amiga Copper doesn't have time to load a new palette for each line.)
  132.     You can still pan SHAM screens, although panning, especially
  133.     vertically, will be very sluggish compared to a HAM screen.
  134.     
  135.     SAVE        (shortcut: 's')
  136.  
  137.     This selection brings up a file requester and allows you to
  138.     save the image as an IFF file.
  139.  
  140.     You need not display an image before saving it.
  141.  
  142.     REVERT        (shortcut: control-R)
  143.     
  144.     This button is enabled any time you change a setting that would
  145.     require you to re-analyze a picture.  It will restore all settings
  146.     to the ones that were used the last time the picture was analyzed.
  147.  
  148.     Close Gadget    (shortcut: 'q')
  149.  
  150.     Clicking the close gadget of the HamLab window exits the program.
  151.  
  152.  
  153. OPTIONS
  154.  
  155.     OUTPUT OPTIONS
  156.     
  157.     SHAM        (shortcut: 'm')
  158.     
  159.     When this option is enabled, HamLab creates a "Sliced-HAM" image
  160.     rather than a normal HAM image.  A SHAM image uses a different
  161.     palette    for every line (every other line for interlaced images).
  162.     This means that, on some pictures, HamLab can do a much better job
  163.     of minimizing HAM artifacts.
  164.     
  165.     However, SHAM doesn't come without a price.  SHAM pictures will
  166.     show artifacts if they are overscanned horizontally.  They are
  167.     much harder to scroll, and currently no paint program that I
  168.     know of can work with them.
  169.     
  170.     INTERLACE    (shortcut: 'i')
  171.  
  172.     When this option is enabled, the HAM (or SHAM) image will be
  173.     interlaced.  The image size is not changed.
  174.     
  175.     For HAM images, toggling this option does not require any
  176.     recalculations, and can even be done while the image is being
  177.     displayed.  For SHAM images, the image must be re-analyzed.
  178.  
  179.  
  180.     OTHER OPTIONS
  181.     
  182.     USE PIPES    (shortcut: 'p')
  183.  
  184.     When this option is enabled, the next time you OPEN a file, rather
  185.     than creating a huge temporary 24 bit RGB file, the image will be
  186.     piped directly through part of the ANALYZE command using the
  187.     AmigaDOS PIPE: device. Although this saves a lot of temporary file
  188.     space and can get the conversion done faster than going to a
  189.     temporary file,    even in RAM:, it does mean that if you need to
  190.     re-quantize an image (like after you turn dithering on or off),
  191.     the image must be re-opened and converted from its original format
  192.     all over again.
  193.  
  194.     FIX BACKGROUND    (shortcut: 'k')
  195.     
  196.     This option causes HamLab to reserve color 0 for the background/
  197.     border color, and assign the other 15 to minimize fringing within
  198.     the picture.  Normally, HamLab will assign all 16 colors to
  199.     minimize fringing, then assign the closest background match to
  200.     color 0.
  201.  
  202.     In SHAM mode, this option has a different meaning.  To be compatible
  203.     with current SHAM viewers, HamLab forces color 0 to be black for
  204.     SHAM pictures.  If this option is turned on, HamLab will use the
  205.     true background color, instead.
  206.  
  207.     After toggling this option, the image must be re-analyzed, but the
  208.     24-bit to 12-bit quantization will not be recomputed unless changing
  209.     one of the other options necessitates it.
  210.  
  211.     FREEZE PALETTE    (shortcut: 'f')
  212.     
  213.     While this option is set, HamLab will keep the current palette
  214.     and not do any analysis to find a better one.
  215.     
  216.     This can be useful if you wish to convert several images using the
  217.     same palette.  Load one, analyze it, and lock the palette for the
  218.     remaining pictures.
  219.     
  220.     This option can also be useful if you want to improve rendering
  221.     in a portion of the image.  Crop out the unimportant parts of the
  222.     picture, then analyze it.  Lock the palette, then restore the
  223.     cropping area to the full image.
  224.     
  225.     FAST ANALYZE    (shortcut: 'z')
  226.  
  227.     This option affects how HamLab chooses the 16 color palette used to
  228.     minimize HAM fringing artifacts.  When disabled, HamLab analyzes
  229.     the picture separately for each of the 16 colors, each time picking
  230.     the one    which helps the most.  When enabled, HamLab only analyzes
  231.     the picture once and then picks all 16 colors.  Although the slow
  232.     analysis should, in theory, be better, in practice, I notice little
  233.     or no difference in quality between the two methods, and the fast
  234.     analysis is 16 times as fast.
  235.  
  236.     After toggling this option, the image must be re-analyzed, but the
  237.     24-bit to 12-bit quantization will not be recomputed unless changing
  238.     one of the other options necessitates it.
  239.  
  240.  
  241.     SCALING OPTIONS
  242.  
  243.     HamLab incorporates very fast scaling routines which can resize
  244.     a 24-bit image to anything from 10 to 1000 percent of its original
  245.     size.  You can enter separate scale values for X and Y directions,
  246.     and you can specify them either as a percentage of the original
  247.     size, or as the desired size in pixels.
  248.     
  249.     QUICK SELECTION (shortcuts: 'x' 'y')
  250.     
  251.     A few commonly used scaling values are built into HamLab as special
  252.     cases so that they'll run even faster.  Clicking on the X or Y
  253.     letters will cycle between these values, which are:
  254.     
  255.         X: 50%, 100%
  256.         Y: 50%, 100%, 200%
  257.  
  258.     CONSTRAIN    (shortcut: '=')
  259.     
  260.     When the '=' gadget is selected, changing one scale value will
  261.     automatically change the other proportionally.  With the gadget
  262.     off, you can make changes to one value at a time and correct aspect
  263.     ratios.
  264.  
  265.     When you change scaling values, the image must be re-quantized.
  266.     
  267.     NOTE: When you load a new picture, the scaling values will be
  268.     unchanged.  Usually you'll want to have the scaling gadgets in
  269.     percent mode, or else the picture will be scaled to the same
  270.     size as the last one.
  271.     
  272.     CROPPING OPTIONS
  273.     
  274.     Using these options you can throw out all but a portion of the
  275.     image.  You can set the cropping area in three ways:
  276.     
  277.         Specify the upper left corner and the size of the
  278.         cropping area.
  279.         
  280.         Specify the upper left corner and the lower right
  281.         corner.
  282.         
  283.         Display the picture, hold down the shift key, then use
  284.         the left mouse button to select the cropping area.
  285.         
  286.     Whenever you change the cropping area, you must re-analyze the
  287.     image.  Since you still have the same number of colors in the
  288.     palette to minimize fringing, but a smaller area to cover, you
  289.     can usually get slightly better results on cropped areas than
  290.     the whole image.
  291.     
  292.         FULL IMAGE    (shortcut: '#')
  293.     
  294.     This button resets the cropping area to include the entire image.
  295.     
  296.     COLOR CONTROL OPTIONS
  297.  
  298.     HamLab allows you to modify 24-bit RGB data by using each red,
  299.     gren, or blue value as an index into a lookup table.  These tables
  300.     are shown on the screen as "Color Response Curves."  You can
  301.     manipulate these curves through the Brightness, Contrast, and Gamma
  302.     controls, or you can use the mouse to draw parts of the curve by
  303.     hand.
  304.     
  305.     RED        (shortcut: 'r')
  306.     GREEN        (shortcut: 'g')
  307.     BLUE        (shortcut: 'b')
  308.     
  309.     These buttons make the corresponding curves active and inactive
  310.     so that you can work on them individually or in combination.
  311.         
  312.     BRIGHTNESS    (shortcuts: '(' ')')
  313.     
  314.     Shifts the color response curves up (brighter) and down (dimmer).
  315.  
  316.     CONTRAST    (shortcuts: '[' ']')
  317.     
  318.     Changes the slope of the active color response curves.  A steeper
  319.     curve will result in a more contrasty image.
  320.  
  321.     GAMMA        (shortcuts: 'c' 'u')
  322.     
  323.     (The letters stand for "Compensate" and "Uncompensate.")
  324.     
  325.     Gamma refers to the nonlinearity of an real-world device like a
  326.     monitor.  Basically, this means that changing from 0 to 1 may
  327.     not produce the same change in brightess as going from 14 to 15.
  328.     Different monitors have different gammas (1.0 is perfectly linear,
  329.     but most NTSC monitors are more like 2.2), so the same image will
  330.     look different depending on the monitor.
  331.     
  332.     The use of this option depends on the original image.  Images
  333.     created by Amiga programs are likely intended for NTSC or PAL
  334.     monitors and won't need gamma correction, while VGA GIF images
  335.     are probably intended for monitors with lower gamma.  If you
  336.     know the gammas of the original image and of your monitor, you
  337.     can enter the original gamma, hit "Uncompensate," enter the
  338.     new gamma, and hit "Compensate."  Experimentation helps.
  339.     
  340.     Gamma correction can have other uses, too.  By setting the gamma
  341.     value to something like 1.1, clicking "Compensate" will gradually
  342.     bring dark portions of the picture out of the shadows while
  343.     reducing the contrast of the lighter portions.
  344.     
  345.     NEGATE        (shortcut: 'n')
  346.     
  347.     Inverts all active curves so that the image produced looks like a
  348.     photographic negative.
  349.     
  350.     INIT        (shortcut: ',')
  351.     
  352.     Resets each curve to a 45-degree line, so that the output exactly
  353.     matches the input.  ONly the active curves are affected.
  354.     
  355.     LOAD        (shortcut: '.')
  356.     
  357.     Brings up a file requester and allows you to load the color response
  358.     curves.  Only the active curves will be loaded.
  359.     
  360.     SAVE        (shortcut: '/')
  361.     
  362.     Brings up a file requester and allows you to save the color response
  363.     curves.  All three curves are always saved.
  364.  
  365.     DITHERING OPTIONS
  366.  
  367.     Whenever the 24-bit file is squeezed into the Amiga's 12-bit
  368.     palette, (the quantizing operation) some loss of color accuracy may
  369.     occur.  The fastest way to quantize is to simply pick the closest
  370.     12-bit color for each pixel, but for some images this can cause
  371.     "banding," an artifact where a gradual color change results in
  372.     several sharp-edged bands of color. (This happens a lot in soft
  373.     shadows.)
  374.  
  375.     Dithering can significantly improve the results when converting
  376.     images which began life on a system with a larger color palette,
  377.     such as the 262,144 color palette used by the VGA and the 16.7
  378.     million    color palette of many 8-bit and    24-bit systems.
  379.  
  380.     After changing dithering options, the image must be re-quantized.
  381.  
  382.     NONE        (shortcut: '0')
  383.  
  384.     All dithering is disabled.  This is the fastest option.
  385.     
  386.     FLOYD-STEINBERG    (shortcut: '1')
  387.     
  388.     Whenever each pixel is quantized, the resulting error is
  389.     distributed to four adjacent pixels.  In my opinion, this selection
  390.     is a good tradeoff between computing time and quality.
  391.     
  392.     JARVIS        (shortcut: '2')
  393.     
  394.     Similar to Floyd-Steinberg, except the error is distributed to 12
  395.     pixels.  Quite slow.
  396.     
  397.     STUCKI        (shortcut: '3')
  398.     
  399.     Very similar to Jarvis and about the same speed.
  400.     
  401.     ORDERED        (shortcut: '4')
  402.     
  403.     Uses fixed patterns to represent intermediate shades.  This option
  404.     is quite fast, but the regular dithering patterns aren't as
  405.     pleasing as the more irregular patterns produced by
  406.     Floyd-Steinberg.
  407.     
  408.     RANDOM        (shortcut: '5')
  409.     
  410.     Adds some random noise to the picture while quantizing.  This
  411.     avoids the regular patterns of ordered dithering, but the resulting
  412.     image can look like a TV with bad reception.  About the same speed
  413.     as ordered dithering.
  414.     
  415.     SPIRAL-DOT    (shortcut: '6')
  416.     
  417.     Similar to ordered dithering, and the same speed, but the patterns
  418.     used makes it look like you're looking through a screen.  This
  419.     looks better the farther away you get.  Seriously.
  420.  
  421.     
  422. MISCELLANEOUS
  423.  
  424.     HamLab and its input filters are "pure" code, so they can be made
  425.     resident if you so desire.
  426.  
  427.     Displaying the picture is the only thing that requires any
  428.     significant amounts of CHIP RAM. Note that a 640 x 480 HAM image
  429.     takes about 230K of CHIP ram, though not all contiguous.
  430.  
  431.  
  432. ACKNOWLEDGEMENTS
  433.  
  434.     Thanks to Scott Rider for assistance in debugging and testing,
  435.     and to everyone who submitted suggestions and comments on the
  436.     original version.
  437.  
  438.